﻿@using Xproject.Util;
@using Model.Util.DTO;
@using Model.Util;
@{
    Layout = null;
    string Domain = CommonHelper.GetAppSettings("Domin");
}
@model AttributeGroupListModel
    <!DOCTYPE html>

    <html>

    <head>
        <meta name="viewport" content="width=device-width" />
        <title>属性分组列表</title>

        <link href="~/Content/categoryCss/site.css" rel="stylesheet" />
        <script src="~/Scripts/jquery-1.10.2.js"></script>
        <script src="~/Scripts/layer/layer.js"></script>
        <script type="text/javascript" src="/admin_mall/scripts/showlist.js"></script>
        <script type="text/javascript">
            function DelAttrGroup(obj, attrGroupId) {
            layer.confirm('确认删除此分类？', {
                btn: ['确认', '取消'] //按钮
            }, function () {

                    $.ajax({
                         url: "@(Domain+ "/Category/DelAttributeGroup")",
                    type: 'post',
                    cache: 'false',
                    async: 'false',
                    data: { attrGroupId: attrGroupId },
                    success: function (data) {
                        if (data.Success == true) {
                            layer.alert('删除成功', { icon: 1, skin: 'layer-ext-moon', time: 2000 });                            
                            $(obj).parent().parent().remove();
                        } else {
                            layer.alert('删除失败', { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                        }
                           },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {

                        }
                    });


                }, function () {
                    layer.closeAll('dialog');
                }
               );

        }
        </script>

        <style type="text/css">
            /*分类树*/
            #categoryTree {
                padding-left: 15px;
                margin-top: 15px;
                text-align: left;
            }

                #categoryTree thead th {
                    background: #dbeffa;
                    font-weight: normal;
                    cursor: pointer;
                    padding: 4px 0;
                    padding-left: 10px;
                }

                #categoryTree table tbody th {
                    text-align: left;
                    font-weight: normal;
                }

                    #categoryTree table tbody th span {
                        display: inline-block;
                        width: 16px;
                        height: 16px;
                        cursor: pointer;
                    }

                        #categoryTree table tbody th span.openthis {
                            background: url('../../Content/images/tree_open.gif') no-repeat center center;
                        }

                        #categoryTree table tbody th span.closethis {
                            background: url('../../Content/images/tree_close.gif') no-repeat center center;
                        }

                #categoryTree tbody td, #categoryTree tbody th {
                    border-bottom: 1px solid #ececec;
                    padding: 4px 0;
                    padding-left: 10px;
                }

                #categoryTree table tbody tr {
                    display: table-row;
                }

                    #categoryTree table tbody tr.tree1 {
                        display: table-row;
                    }

            .clear {
                clear: both;
            }

            .left {
                float: left;
            }

            .right {
                float: right;
            }
            /*右侧Right*/
            .rightH1 {
                border-bottom: 2px solid #93aebf;
                font-size: 12px;
                color: #135275;
                height: 30px;
                line-height: 30px;
                position: relative;
                margin-left: 15px;
            }

                .rightH1 div {
                    font-size: 14px;
                    position: absolute;
                    top: 3px;
                    *top: 3px;
                    _top: 10px;
                    right: 0px;
                    _right: 5px;
                }

                .rightH1 img {
                    width: 32px;
                    height: 24px;
                }
        </style>
    </head>
    <body>
        <h1 class="rightH1">
            分组管理 &gt;&gt; 分组列表
            <div class="right">
                <a href="@Url.Action("CategoryList")" class="menuBT"><img src="../../content/images/goback.jpg"   />返回分类</a>
                <a href="@Url.Action("AddattributeGroup", new { cateId= Model.CateId})" class="menuBT"><img src="../../content/images/add.jpg" />添加分组</a>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </h1>
        <div class="table_top"></div>
        <div class="dataList">
            <table width="100%">
                <thead>
                    <tr>
                        <th width="10" align="left"></th>
                        <th width="80" align="left">编号</th>
                        <th width="250" align="left">名称</th>
                        <th align="left">所属分类</th>
                        <th width="80" align="left">排序</th>
                        <th width="100" align="left">管理操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (CategoryAttrGroups info in Model.AttributeGroupList)
                {
                    <tr>
                        <td></td>
                        <td>@info.AttrGroupId</td>
                        <td>@info.Name</td>
                        <td>@Model.CategoryName</td>
                        <td>@info.DisplayOrder</td>
                        <td>
                            @Html.ActionLink("[编辑]", "EditAttributeGroup", new { attrGroupId = info.AttrGroupId }, new { @class = "editOperate" })|
                            <a href="#" onclick="DelAttrGroup(this,'@info.AttrGroupId')" class="deleteOperate">[删除]</a>
                           
                        </td>
                    </tr>
            }
                </tbody>
            </table>
        </div>
        <div class="table_bottom"></div>
    </body>
    </html>